n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
d = [0] * n
for i in range(n):
    for j in range(i + 1, n):
        if a[i] % a[j] == 0:
            d[i] += 1
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if a[i] % a[j] == 0:
            ans += d[j]
print(ans)
